package com.huwaiwai.queue.priorityblockingqueue;

import java.util.concurrent.PriorityBlockingQueue;

/**
 * Created by hww on 2018/7/5 下午1:11.
 */
public class Test {

    public static void main(String [] args) {
        PriorityBlockingQueue<Long> pbq = new PriorityBlockingQueue();
        pbq.offer(1L);
        pbq.offer(5L);
        pbq.offer(7L);
        pbq.offer(6L);
        pbq.offer(4L);

        System.out.println(pbq.poll());
        System.out.println(pbq.poll());
        System.out.println(pbq.poll());
        System.out.println(pbq.poll());
        System.out.println(pbq.poll());

    }
}
